home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / Host Automation Folder / VU External Tool libs / ThreadedVUTool.vulib < prev    next >
Encoding:
Text File  |  1998-03-19  |  3.1 KB  |  80 lines  |  [TEXT/MPS ]

  1. (*
  2.  *    File:        ThreadedVUTool.vulib
  3.  *
  4.  *    Contains:    The tool definition along with the high level tasks to access
  5.  *                the tool's services
  6.  *
  7.  *    
  8.  *    Written by:    SBR from FileTool by P. Nagarajan
  9.  *
  10.  *    Copyright:    © 1992-1997 by Apple Computer, Inc., all rights reserved.
  11.  *
  12.  *    Change History (most recent first):
  13.  *
  14.  *        <1.3>    01/24/97    JAS        Added common XTool services (Initialize, etc.)
  15.  *        <1.2>    06/24/96    SBR        Added TestSleepTicks, ThreadStatus, FreeMemory.
  16.  *        <1.1>     02/07/95    SBR        Synchronize with HLQ Automation.
  17.  *                 10/30/94    SBR        Built with Echo service
  18.  *                 03/26/93    NAGA    xxx put comment here xxx
  19.  *
  20.  *    To Do:
  21.  *)
  22.  
  23. tool ThreadedVUTool s:'vu21'
  24. begin
  25.     # Services specific to ThreadedVUTool:
  26.     
  27.     # To Echo a list after a number of ticks, in a new thread 
  28.     Service    "EchoThread"( 'undefined', 'integer', 'symbol', 'integer' ) return 'undefined';
  29.     # first parameter is the value or list of values to echo 
  30.     # second parameter is the number of ticks to pause before returning
  31.     # third parameter is Boolean: 
  32.     #        true means beep entering and leaving ProcessRequest()
  33.     #        false means do not 
  34.     # fourth parameter is integer n: 
  35.     #        non-zero means beep after every n loops waiting for the cancel
  36.     #        zero means do not beep while looping
  37.     # return value should be equal to first parameter except when:
  38.     #        symbol and descriptor parameters are turned into strings by VU
  39.     #        integers are sent to the tool as long or short based on VU version
  40.     #        longs are sent to the script as long or string based on VU version
  41.     
  42.     # To Echo a list after a number of ticks, in the RequestDispatcher thread 
  43.     Service    "EchoNoThread"( 'undefined', 'integer', 'symbol', 'integer' ) return 'undefined';
  44.     # same as Echo service except this one is non-threaded
  45.     
  46.     # To set the number of ticks given to WaitNextEvent() in the tool
  47.     # Only affects the tool when it is in the background
  48.     # returns the previous value
  49.     Service    "SetSleepTicks"( 'integer' ) return 'integer';
  50.     # first parameter is put into the WaitNextEvent() sleep parameter  
  51.         
  52.     # Test the effects of SetSleepTicks using a non-threaded loop
  53.     # SetSleepTicks only affects the tool when it is in the background
  54.     # Call with async:true, or, set ExternalToolTimeout to 5 + first parameter
  55.     # returns the average number of times it looped per second
  56.     Service    "TestSleepTicks"( 'integer' ) return 'integer';
  57.     # first parameter is the number of seconds to loop calling CheckForCancel
  58.         
  59.     # To get the status of the threaded service support
  60.     # Use this to determine if threaded services in general are available
  61.     # returns "Enabled", "Disabled", "Unavailable"
  62.     Service    "ThreadStatus"( ) return 'undefined';
  63.         
  64.     # To get the amount of Free Memory in the tool's heap
  65.     # Comes from FreeMem() OS Memory Manager call, use for finding memory leaks
  66.     # returns a long integer
  67.     Service    "FreeMemory"( ) return 'integer';
  68.     
  69.     
  70.     # Services common to all Virtual User external tools:
  71.     
  72.     Service "Initialize"( 'symbol' );        # pass TRUE for target, FALSE for host
  73.     Service "Cancel"( 'string' );
  74.     Service "GetToolServices"() return 'list';
  75.     Service "GetToolVersion"() return 'list';
  76.     Service "Poll"( 'string' ) return 'list';
  77.     Service "ServiceSupported"( 'string' ) return 'symbol';
  78.     Service "Quit"();
  79.  
  80. end;